package com.hong.decorator;

import com.hong.aop.Greeting;
import com.hong.aop.GreetingImpl;

public class ClientDecorador {
    public static void main(String[] args) {
        Greeting greeting = new AfterGreetingDecorator(new BeforeGreetingDecorator(new GreetingImpl()));
        greeting.sayHello("Hello Decorator!");

        System.out.println("++++++++++++++");
        //装饰的顺序可以调换
        Greeting greeting1 = new BeforeGreetingDecorator(new AfterGreetingDecorator(new GreetingImpl()));
        greeting1.sayHello("Hello Decorator!");
    }
}
